import { defineStore } from 'pinia';

const usePageStore = defineStore('page', {
  state: () => ({
    // 添加目录类型的type状态 - 默认个人文档
    currentDirType: 2,
    // 添加目录id (doc_dir_id) 状态
    currentDocDirId: null,
  }),

  getters: {
    //   当前类型
    type: (state) => {
      return state.currentDirType;
    },
    //   当前目录id
    dirId: (state) => {
      return state.currentDocDirId;
    },
  },

  actions: {
    setCurrentDirType(type: any) {
      this.currentDirType = type;
    },
    setCurrentDocDirId(id: any) {
      this.currentDocDirId = id;
    },
  },
});

export default usePageStore;
